function Ts = affine_flow(X, ts)
%AFFINE_FLOW Sequence of Transforms for an affine flow
%
%   Ts = AFFINE_FLOW(X, ts);
%
%       generates a sequence of geometric transforms at given time steps
%       for an affine flow.
%
%       Input arguments:
%       - X:        The Lie algebraic representation, a 2 x 3 matrix, 
%                   which is in the following form:
%
%                   X = [a -r  x;
%                        r  b  y ]
%
%       - ts:       The sequence of time steps at which the transform
%                   matrices are to be evaluated. 
%
%       Output arguments:
%
%       - Ts:       The sequence of generated transform matrices.
%
%                   Ts(:,:,i) is the result of the exponentiation map
%                   of ts(i) * X(:,:,i), which is also a 2 x 3 matrix.
%                   
%

% Created by Dahua Lin, on April 4, 2012
%

%% verify input arguments

if ~(isfloat(X) && isreal(X) && isequal(size(X), [2 3]) && ~issparse(X))
    error('affine_flow:invalidarg', ...
        'X should be a 2 x 3 non-sparse real matrix.'); 
end

if ~(isfloat(ts) && isreal(ts) && isvector(ts))
    error('affine_flow:invalidarg', 'ts should be a real vector.');
end

ts = cast(ts, class(X));

%% main

Ts = affine_flow_cimp(X, ts);

